import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import get from '@dfeidao/atom-mobile/local/get';
import set from '@dfeidao/atom-mobile/local/set';
import show_sheet from '@dfeidao/atom-mobile/msgbox/action-sheet';
import render from '@dfeidao/atom-mobile/render/render';


export default async function a002(fd: IFeidaoAiMobile, ...args: [string]) {
	// 选择性别

	const d = get(fd, 'data') as { sex: string, sexing: string };
	// const sexing = args[0];
	// if (sexing === "男") {
	// 	d.sex = "0";
	// }
	// if (sexing === "女") {
	// 	d.sex = "1";
	// }
	// set(fd, 'sexing', sexing);
	// d.sexing = sexing;
	// render(fd, { d });
	// set(fd, 'data', d);


	const res = await show_sheet({
		// options: ['a', 'b', 'c', 'd'],
		options: [
			// { text: '男', icon: 'american-football', iconColor: '#2c8ef4' },
			// { text: '女', icon: 'analytics', iconColor: '#f42ced' },
			{ text: '男' },
			{ text: '女' },
			// { text: 'Option 2', icon: 'aperture', iconColor: '#ea943b' },
			// { text: 'Delete', icon: 'trash', iconColor: '#fa213b' },
			{ text: '取消' }
		],
		cancelButtonIndex: 2,
		// destructiveButtonIndex: 3,
		title: '性别'
	});

	if (res === 0) {
		d.sexing = "男";
	}
	if (res === 1) {
		d.sexing = "女";

	}
	d.sex = res.toString();
	// set(fd, 'sexing', sexing);
	// d.sexing = sexing;
	render(fd, { d });
	set(fd, 'data', d);
	// debugger;
}
